<style>
    body{
        font-size: 12px;
    }
    .bag{
        color: #fff;
        width: 4px;
        text-align: center;
    }
    .bag-1{
        background-color: #e74c3c;
    }
    .bag-2{
        background-color: #3498db;
    }
    .bag-3{
        background-color: #f39c12;
    }
    .bag-4{
        background-color: #18bc9c;
    }
    .bag-5{
        background-color: #605ca8;
    }
    .bag-6{
        background-color: #e74c3c;
    }
    .bag-7{
        background-color: #3498db;
    }
    .bag-8{
        background-color: #f39c12;
    }
    .bag-9{
        background-color: #18bc9c;
    }
    .bag-0{
        background-color: #605ca8;
    }
    .color-gray{
        color: #999999;
    }
    .margin-left{
        margin-left: 20px;
    }

</style>
<div class="panel panel-default panel-intro">
    <div class="panel-body">
        {volist name="list" id="item" key="key"}
        <table  class="table table-striped table-bordered table-hover table-nowrap">
            <tbody>
                <tr style="background-color: #fff ">
                    <td rowspan="3" class="bag bag-{:substr($key,strlen($key)-1,strlen($key))}" style="text-align: center; vertical-align: middle;">
                        <div>包</div>
                        <div>裹</div>
                        <div class="text-center">{$key}</div>
                    </td>
                    <td style=" vertical-align: middle;">
                        包裹单号:<span class="color-gray">{$item.package_no}</span>
                        <span class="margin-left">发货状态:
                            {if $item.freight.type == 'ziti'}
                            {if $item.delivery_status}
                                <span class="label label-success">
                                   客户已取货
                                </span>
                            {else/}
                                <span class="label label-default">
                                    客户未取货
                                </span>
                            {/if}
                            {else /}
                            {if $item.delivery_status}
                                {if $item.delivery_mode =='self'}
                                <span class="label label-success">
                                   自发完成
                                </span>
                                {else/}
                                <span class="label label-info">
                                   代发完成
                                </span>
                                {/if}

                            {else/}
                                {if $item.delivery_mode =='instead'}
                                    <span class="label label-success">
                                        代发中
                                    </span>
                                {else /}
                                    <span class="label label-default">
                                       未发货
                                    </span>
                                    <button class="btn btn-xs btn-warning margin-left btn-delivery" data-id="{$item.id}">包裹推送</button>

                                {/if}
                            {/if}
                            {/if}


                        </span>
                        {if $item.delivery_status && $item.freight.type != 'ziti'}
                        <span class="margin-left">{$item.express_name}:
                            {$item.express_no}
                            <button class="btn btn-xs btn-default btn-track" data-id="{$item.id}">追踪</button>
                            <button class="btn btn-xs btn-default btn-print" data-id="{$item.id}">打印面单</button>
                        </span>
                        {/if}
                        <span class="margin-left">包裹照片:
                            {if $item.image}
                            <button class="btn btn-xs btn-default btn-package-image" data-value="{$item.image}">查看</button>
                            {else /}
                            <button class="btn btn-xs btn-default btn-upload " data-id="{$item.id}">上传包裹照片</button>
                            {/if}

                        </span>

                        <span class="margin-left">身份证上传状态:
                            {if $item.idcard_status}
                            <span class="color-gray">已上传</span>
                            {else /}
                            <button class="btn btn-xs btn-default btn-upload-idcard " data-id="{$item.id}">上传</button>
                            {/if}

                        </span>

                    </td>
                </tr>
                <tr>
                    <td style="padding: 0">
                        <table class="table table-striped table-bordered table-hover table-nowrap" style="margin-bottom: 0px">
                            <thead>
                            <tr style="background-color: #F2F2F2">
                                <th style="text-align: center; vertical-align: middle;">
                                    <div class="th-inner">编号</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle;">
                                    <div class="th-inner">图片</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle;">
                                    <div class="th-inner">名称</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle;">
                                    <div class="th-inner">数量</div>
                                </th>
                                <th style="text-align: center; vertical-align: middle;">
                                    <div class="th-inner">销售价</div>
                                </th>

                            </tr>
                            </thead>
                            <tbody>
                            {volist name="item.goods" id="goods"}
                            <tr>
                                <td style="text-align: center; vertical-align: middle;">{$key+1}</td>
                                <td style="text-align: center; vertical-align: middle;">
                                    <a href="javascript:">
                                        <img data-tips-image class="img-sm img-center" src="{$goods.image}">
                                    </a>
                                </td>
                                <td style="text-align: center; vertical-align: middle;">
                                    <strong>{$goods.title}</strong><br>
                                    {$goods.difference}
                                </td>
                                <td style="text-align: center; vertical-align: middle;">{$goods.number}</td>
                                <td style="text-align: center; vertical-align: middle;">{:bcmul($goods.price,$goods.number,2)}</td>
                                <td style="text-align: center; vertical-align: middle;">{:bcmul($goods.supply_price,$goods.number,2)}<br></td>
                                <td style="text-align: center; vertical-align: middle;" class="text-danger">{:bcmul($goods.price,$goods.number,2) - bcmul($goods.supply_price,$goods.number,2)}<br></td>
                                <td style="text-align: center; vertical-align: middle;">{$goods.number}</td>
                                <td style="text-align: center; vertical-align: middle;">{$goods.number}</td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </td>
                </tr>

                <tr style="background-color: #fff">
                    <td style=" vertical-align: middle;">
                        地址信息:<span class="color-gray">{$item.address.address}</span>
                        <span class="margin-left">{$item.address.name}身份证信息:
                            {$item.address.number}
                            <button class="btn btn-xs btn-default" data-tips-image="{$item.address.image_front}">身份证正面</button>
                            <button class="btn btn-xs btn-default" data-tips-image="{$item.address.image_back}">身份证反面</button>
                        </span>
                        拍照标记:<span  class="color-gray">{if $item.phone_price >0 }<span style="font-weight: bold;color: darkred">需要</span>{else/}不需要{/if}</span>
                        气柱:<span  class="color-gray">{if $item.shox_price >0 }<span style="font-weight: bold;color: darkred">需要</span>{else/}不需要{/if}</span>
                    </td>
                </tr>
            </tbody>
        </table>
        {/volist}
    </div>
</div>
<script type="text/html" id="upload-image">

    <form id="upload-form" class="form-horizontal form-layer" method="POST" action="">
        <div class="form-body">
            <div class="form-group">
                <label for="c-avatar" class="control-label col-xs-12 col-sm-2">包裹图片:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-avatar" data-rule="" class="form-control" size="50" name="row[image]" type="text" value="">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="plupload-avatar" class="btn btn-danger plupload" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> 上传</button></span>
                            <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> 选择</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-avatar"></span>
                    </div>
                    <ul class="row list-inline plupload-preview" id="p-avatar"></ul>
                </div>
            </div>

        </div>
        <div class="form-footer">
            <div class="form-group" style="margin-bottom:0;">
                <label class="control-label col-xs-12 col-sm-3"></label>
                <div class="col-xs-12 col-sm-8">
                    <button type="submit" class="btn btn-md btn-info">{:__('Submit')}</button>
                </div>
            </div>
        </div>
    </form>
</script>